package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.MemberInfo;
import cn.wolfcode.crm.qo.MemberInfoQueryObject;
import cn.wolfcode.crm.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface MemberInfoMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MemberInfo record);

    MemberInfo selectByPrimaryKey(Long id);

    List<MemberInfo> selectAll();

    int updateByPrimaryKey(MemberInfo record);

    //分页
    int rows(QueryObject queryObject);

    List<?> queryForList (QueryObject qo);
    //取消会员
    void changeState(Long id);

    void updateCardNum(@Param("cardnumber") long cardnumber,@Param("memberId") Long memberId);
    //会员消费
    void updateVipConsume(MemberInfo vip);

    void updateBalance(@Param("newBalance") BigDecimal newBalance,
                       @Param("memberId") Long memberId,
                       @Param("chargeTotalAmount") BigDecimal chargeTotalAmount);

    MemberInfo selectByCardNumber(String cardNumber);

    List<?> selectMemberConsumeInfo(MemberInfoQueryObject qo);

   Map<String,Object> selectData();

    MemberInfo selectByConsumption(BigDecimal consumption);
}